/**
 * Copyright (C) 2012 The SkyTvOS Project
 * <p/>
 * Version     Date           Author
 * ─────────────────────────────────────
 * 2014年12月27日         Root.Lu
 */

package com.coocaa.launcher.framework.launcherhost.statusbar;

import android.content.Context;

import com.coocaa.x.framework.app.Container;

public abstract class StatusBarPlugin extends Container {
    public interface IStatusBarPluginListener {
        void onStatusBarPluginCreate(StatusBarPlugin item);

        void onStatusBarPluginDestroy(StatusBarPlugin item);
    }

    protected static Context mContext = null;

    public static void setContext(Context context) {
        mContext = context;
    }

    private IStatusBarPluginListener listener = null;

    public StatusBarPlugin(String name) {
        super(name);
        // TODO Auto-generated constructor stub
    }

    public final void setListener(IStatusBarPluginListener listener) {
        this.listener = listener;
    }

    @Override
    protected void onCreate() {
        // TODO Auto-generated method stub
        if (listener != null)
            listener.onStatusBarPluginCreate(this);
    }

    @Override
    protected void onDestroy() {
        // TODO Auto-generated method stub
        if (listener != null)
            listener.onStatusBarPluginDestroy(this);
    }

    public void show() {
    }

    public void hide() {

    }

    public abstract StatusBarPluginView inflate(String pattern);
}
